home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / CMPLTPAS / EVALUTOR.PAS < prev    next >
Pascal/Delphi Source File  |  1988-07-15  |  506b  |  24 lines

  1. PROGRAM Evaluator;
  2.  
  3. VAR 
  4.   SST    : String;
  5.   R      : Real;
  6.   Result : Integer;
  7.  
  8. BEGIN
  9.   REPEAT
  10.     Write('>>Enter a number in string form: ');
  11.     Readln(SST);
  12.     IF Length(SST) > 0 THEN
  13.       BEGIN
  14.         Val(SST,R,Result);
  15.         IF Result <> 0 THEN
  16.           Writeln
  17.           ('>>Cannot evaluate that string.  Check character #',Result)
  18.         ELSE
  19.           Writeln
  20.           ('>>The numeric equivalent of that string is ',R:18:10)
  21.       END
  22.   UNTIL Length(SST) = 0
  23. END.
  24.